Eclipse Platform
Pre-release 3.0

org.eclipse.team.core.subscribers
Class ContentComparisonCriteria

java.lang.Object
  extended byorg.eclipse.team.core.subscribers.ComparisonCriteria
      extended byorg.eclipse.team.core.subscribers.ContentComparisonCriteria

public class ContentComparisonCriteria
extends ComparisonCriteria

A content comparison criteria that knows how to compare the content of IStorage and IRemoteResource objects. The content comparison can be configured to ignore or consider whitespace.

See Also:
ComparisonCriteria

Field Summary
static String ID_DONTIGNORE_WS
           
static String ID_IGNORE_WS
           
 
Constructor Summary
ContentComparisonCriteria(ComparisonCriteria[] preConditions, boolean ignoreWhitespace)
           
 
Method Summary
 boolean compare(Object e1, Object e2, IProgressMonitor monitor)
          Helper methods for comparisons that returns true if the resource contents are the same.
 String getId()
          Return the unique id that identified this comparison criteria.
 String getName()
          Return the comparison criteria, in a format that is suitable for display to an end user.
protected  boolean shouldIgnoreWhitespace()
           
 boolean usesFileContents()
           
 
Methods inherited from class org.eclipse.team.core.subscribers.ComparisonCriteria
checkPreConditions, getPreConditions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID_IGNORE_WS

public static final String ID_IGNORE_WS
See Also:
Constant Field Values

ID_DONTIGNORE_WS

public static final String ID_DONTIGNORE_WS
See Also:
Constant Field Values
Constructor Detail

ContentComparisonCriteria

public ContentComparisonCriteria(ComparisonCriteria[] preConditions,
                                 boolean ignoreWhitespace)
Method Detail

getName

public String getName()
Description copied from class: ComparisonCriteria
Return the comparison criteria, in a format that is suitable for display to an end user.

Specified by:
getName in class ComparisonCriteria

getId

public String getId()
Description copied from class: ComparisonCriteria
Return the unique id that identified this comparison criteria.

Specified by:
getId in class ComparisonCriteria

compare

public boolean compare(Object e1,
                       Object e2,
                       IProgressMonitor monitor)
                throws TeamException
Helper methods for comparisons that returns true if the resource contents are the same. If timestampDiff is true then the timestamps don't differ and there's no point checking the contents.

Specified by:
compare in class ComparisonCriteria
Parameters:
e1 - object to be compared
e2 - object to be compared
monitor -
Returns:
Throws:
TeamException

shouldIgnoreWhitespace

protected boolean shouldIgnoreWhitespace()

usesFileContents

public boolean usesFileContents()
Overrides:
usesFileContents in class ComparisonCriteria

Eclipse Platform
Pre-release 3.0

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.